import {LocalStore} from "@/driver/LocalStore"

const UserSessionService = {
    __KEY_SESSION: 'session.token',
    __KEY_USER_INFO: 'session.user',
    getToken(call) {
        return LocalStore.get(this.__KEY_SESSION, call)
    },
    saveToken(token) {
        LocalStore.save(this.__KEY_SESSION, token)
    },
    removeToken() {
        LocalStore.remove(this.__KEY_SESSION)
    },

    getUserInfo(call) {
        return LocalStore.get(this.__KEY_USER_INFO, call)
    },
    saveUserInfo(user) {
        LocalStore.save(this.__KEY_USER_INFO, user)
    },
    removeUserInfo() {
        LocalStore.remove(this.__KEY_USER_INFO)
    }
}

export default UserSessionService